package com.liu.community.enums;/*
 *@Author:Liu Xing-zhi
 *Description:
 *Date:Crated in 9:34 2021/10/13
 */

public enum CommentTypeEnum {
    QUESTION(1),
    COMMENT(2),
    BLOG(3),
    BLOG_COMMENT(4);
    private  Integer type;

    CommentTypeEnum(Integer type) {
        this.type = type;
    }

    public static boolean isExist(Integer type) {
        for (CommentTypeEnum value : CommentTypeEnum.values()) {
            if (value.getType() == type){
                return  true;
            }
        }
        return  false;
    }

    public Integer getType() {
        return type;
    }
    public  static Integer getTypes(Integer type){
        for (CommentTypeEnum commentTypeEnum : CommentTypeEnum.values()) {
            if (commentTypeEnum.getType() == type){
                return  commentTypeEnum.getType();
            }
        }
        return 0;
    }
}
